home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / comp / makelist.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  1.3 KB  |  48 lines

  1. /*
  2.                              M A K E L I S T . C
  3.  
  4.     Possibilities:
  5.         1- makelist(int, string)
  6.         2- makelist(int, string, older, string)     -- younger ok too
  7.  
  8.     The parser may have inserted the int-argument as int O_FILE
  9.  
  10. */
  11.  
  12. #include "iccomp.h"
  13.  
  14. ESTRUC_ *makelist(ESTRUC_ *args, E_TYPE_ type)
  15. {
  16.     ESTRUC_
  17.         *e0;
  18.  
  19.     e0 = codestruc(args, 0);
  20.     e0 = codestruc(args, 1);
  21.  
  22.     if
  23.     (                                       /* first arg not int */
  24.         !test_type(codestruc(args, 0), e_int)
  25.         ||                                  /* or second not string */
  26.         !test_type(codestruc(args, 1), e_str)
  27.         ||                                  /* or three arguments, but */
  28.             ( 
  29.               args->type == 3
  30.               &&                            /* last is not string */
  31.               !test_type(codestruc(args, 2), e_str)
  32.             )
  33.     )
  34.     {
  35.         semantic(type_conflict, funstring[f_makelist]);
  36.         return (args);
  37.     }
  38.  
  39.     catargs(args);                          /* catenate all arguments */
  40.  
  41.     if (type != op_hlt)                     /* hidden function called */
  42.         callhidden(type == op_younger, args);
  43.     else
  44.         callrss(args, f_makelist);
  45.  
  46.     return (args);                          /* return called function code */
  47. }
  48.